package topevery.syn.data.model;

import com.alibaba.fastjson.annotation.JSONField;
import lombok.Data;
import topevery.syn.data.model.codec.ModelTypeEnumCodec;

import java.time.LocalDateTime;

@Data
public class EpcClientData implements IGlbModel {

    @JSONField(name = "a")
    public Long gid;

    @JSONField(name = "b", serializeUsing = ModelTypeEnumCodec.class, deserializeUsing = ModelTypeEnumCodec.class)
    public ModelTypeEnum modelType = ModelTypeEnum.Epc;


    @JSONField(name = "d")
    public Long fid;

    @JSONField(name = "e")
    public String connectionId;

    @JSONField(name = "f")
    public String clientIp;

    @JSONField(name = "g")
    public Integer clientPort;

    @JSONField(name = "h")
    public LocalDateTime serverReqDate;

    @JSONField(name = "i")
    public String hostCode;

    @JSONField(name = "j")
    public String dtuCode;

    @JSONField(name = "k")
    public String epcCode;
    /// <summary>
    /// 数据返回时间
    /// </summary>
    @JSONField(name = "l")
    public LocalDateTime clientDate;
    /// <summary>
    /// 信号强度
    /// </summary>

    @JSONField(name = "m")
    public Double signalIntegerensity;
    /// <summary>
    /// 天线端口
    /// </summary>
    @JSONField(name = "n")
    public Integer airwirePort;

    @JSONField(name = "o")
    public LocalDateTime dbCreateDate;

    @JSONField(name = "p")
    public Double lng;

    @JSONField(name = "q")
    public Double lat;
    /// <summary>
    /// 摩卡托lng
    /// </summary>
    @JSONField(name = "r")
    public Double lngMct;
    /// <summary>
    /// 摩卡托lat
    /// </summary>
    @JSONField(name = "s")
    public Double latMct;
    /// <summary>
    /// 百度lng
    /// </summary>
    @JSONField(name = "t")
    public Double lngBd;
    /// <summary>
    /// 百度lat
    /// </summary>
    @JSONField(name = "u")
    public Double latBd;
    /// <summary>
    /// 位置时间
    /// </summary>
    @JSONField(name = "v")
    public LocalDateTime posDate;
    /// <summary>
    /// 方位
    /// </summary>
    @JSONField(name = "w")
    public Integer direction;
    /// <summary>
    /// 速度
    /// </summary>
    @JSONField(name = "x")
    public Double speed;
    /// <summary>
    /// 收星数
    /// </summary>
    @JSONField(name = "y")
    public Short starNumber;
    /// <summary>
    /// 北斗收星数
    /// </summary>
    @JSONField(name = "z")
    public Short starNumberBd;
    /// <summary>
    /// GNSS指标
    /// </summary>
    @JSONField(name = "a1")
    public Double gnssValue;
    /// <summary>
    /// 加速度x轴
    /// </summary>
    @JSONField(name = "a2")
    public Double upspeedX;
    /// <summary>
    /// 加速度y轴
    /// </summary>
    @JSONField(name = "a3")
    public Double upspeedY;
    /// <summary>
    /// 加速度z轴
    /// </summary>
    @JSONField(name = "a4")
    public Double upspeedZ;
    /// <summary>
    /// 电子罗盘x轴
    /// </summary>
    @JSONField(name = "a5")
    public Double compassX;
    /// <summary>
    /// 电子罗盘y轴
    /// </summary>
    @JSONField(name = "a6")
    public Double compassY;
    /// <summary>
    /// 电子罗盘z轴
    /// </summary>
    @JSONField(name = "a7")
    public Double compassZ;

    /// <summary>
    /// 第N组EPC
    /// </summary>
    //public String EpcCodes = String.Empty;

    /// <summary>
    /// 读卡器1信号强度
    /// </summary>
    @JSONField(name = "a8")
    public Double cardReader1SignalIntegerensity;

    /// <summary>
    /// 读卡器2信号强度
    /// </summary>
    @JSONField(name = "a9")
    public Double cardReader2SignalIntegerensity;

    @JSONField(name = "b1")
    public String serviceIp;

    @JSONField(name = "b2")
    public Integer servicePort;

    @JSONField(name = "b3")
    public String boxDtuCode;

    /// <summary>
    /// AccState状态
    /// </summary>
    @JSONField(name = "b4")
    public Integer accState;

    @JSONField(name = "b5")
    public Long gpsFid;

    /// <summary>
    /// 0 实时上传
    /// 1 补传
    /// </summary>
    @JSONField(name = "b6")
    public Short UpType;

    @JSONField(name = "b7")
    public Double speedSrc ;

    @Override
    public String getGlbModelKey() {
        return dtuCode;
    }

    @Override
    public Long getGid() {
        return gid;
    }

    @Override
    public void setGid(Long gid) {
        this.gid = gid;
    }

    @Override
    public ModelTypeEnum getModelType() {
        return modelType;
    }

    @Override
    public void setModelType(ModelTypeEnum modelType) {
        this.modelType = modelType;
    }
}
